package data;

import java.io.Serializable;
import annotation.*;

@Table (name="patient")
public class Patient extends Data implements Serializable {

	/**
	 * 
	 */
	@Ignore
	private static final long serialVersionUID = -8591699700328424643L;
	
	private String nom_patient;
	private String prenom_patient;
	private String sexe_patient;
	private String date_naissance_patient;
	private double taille_patient;
	private double poids_patient;
	private String adresse_patient;
	private int code_postal_patient;
	private String ville_patient;
	private String photo_patient;
	@Id (autoIncrement=false)
	private String numero_securite_sociale_patient;
	private String numero_telephone_patient;
	private String numero_portable_patient;
	private String email_patient;
	
	public Patient(String nom_patient, String prenom_patient,
			String sexe_patient, String date_naissance_patient,
			double taille_patient, double poids_patient,
			String adresse_patient, int code_postal_patient,
			String ville_patient, String photo_patient,
			String numero_securite_sociale_patient,
			String numero_telephone_patient, String numero_portable_patient,
			String email_patient) {
		super();
		this.nom_patient = nom_patient;
		this.prenom_patient = prenom_patient;
		this.sexe_patient = sexe_patient;
		this.date_naissance_patient = date_naissance_patient;
		this.taille_patient = taille_patient;
		this.poids_patient = poids_patient;
		this.adresse_patient = adresse_patient;
		this.code_postal_patient = code_postal_patient;
		this.ville_patient = ville_patient;
		this.photo_patient = photo_patient;
		this.numero_securite_sociale_patient = numero_securite_sociale_patient;
		this.numero_telephone_patient = numero_telephone_patient;
		this.numero_portable_patient = numero_portable_patient;
		this.email_patient = email_patient;
	}
	
	public Patient(){
		super();
	}

	public String getNom_patient() {
		return nom_patient;
	}

	public void setNom_patient(String nom_patient) {
		this.nom_patient = nom_patient;
	}

	public String getPrenom_patient() {
		return prenom_patient;
	}

	public void setPrenom_patient(String prenom_patient) {
		this.prenom_patient = prenom_patient;
	}

	public String getSexe_patient() {
		return sexe_patient;
	}

	public void setSexe_patient(String sexe_patient) {
		this.sexe_patient = sexe_patient;
	}

	public String getDate_naissance_patient() {
		return date_naissance_patient;
	}

	public void setDate_naissance_patient(String date_naissance_patient) {
		this.date_naissance_patient = date_naissance_patient;
	}

	public double getTaille_patient() {
		return taille_patient;
	}

	public void setTaille_patient(double taille_patient) {
		this.taille_patient = taille_patient;
	}

	public double getPoids_patient() {
		return poids_patient;
	}

	public void setPoids_patient(double poids_patient) {
		this.poids_patient = poids_patient;
	}

	public String getAdresse_patient() {
		return adresse_patient;
	}

	public void setAdresse_patient(String adresse_patient) {
		this.adresse_patient = adresse_patient;
	}

	public int getCode_postal_patient() {
		return code_postal_patient;
	}

	public void setCode_postal_patient(int code_postal_patient) {
		this.code_postal_patient = code_postal_patient;
	}

	public String getVille_patient() {
		return ville_patient;
	}

	public void setVille_patient(String ville_patient) {
		this.ville_patient = ville_patient;
	}

	public String getPhoto_patient() {
		return photo_patient;
	}

	public void setPhoto_patient(String photo_patient) {
		this.photo_patient = photo_patient;
	}

	public String getNumero_securite_sociale_patient() {
		return numero_securite_sociale_patient;
	}

	public void setNumero_securite_sociale_patient(
			String numero_securite_sociale_patient) {
		this.numero_securite_sociale_patient = numero_securite_sociale_patient;
	}

	public String getNumero_telephone_patient() {
		return numero_telephone_patient;
	}

	public void setNumero_telephone_patient(String numero_telephone_patient) {
		this.numero_telephone_patient = numero_telephone_patient;
	}

	public String getNumero_portable_patient() {
		return numero_portable_patient;
	}

	public void setNumero_portable_patient(String numero_portable_patient) {
		this.numero_portable_patient = numero_portable_patient;
	}

	public String getEmail_patient() {
		return email_patient;
	}

	public void setEmail_patient(String email_patient) {
		this.email_patient = email_patient;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((adresse_patient == null) ? 0 : adresse_patient.hashCode());
		result = prime * result + code_postal_patient;
		result = prime
				* result
				+ ((date_naissance_patient == null) ? 0
						: date_naissance_patient.hashCode());
		result = prime * result
				+ ((email_patient == null) ? 0 : email_patient.hashCode());
		result = prime * result
				+ ((nom_patient == null) ? 0 : nom_patient.hashCode());
		result = prime
				* result
				+ ((numero_portable_patient == null) ? 0
						: numero_portable_patient.hashCode());
		result = prime
				* result
				+ ((numero_securite_sociale_patient == null) ? 0
						: numero_securite_sociale_patient.hashCode());
		result = prime
				* result
				+ ((numero_telephone_patient == null) ? 0
						: numero_telephone_patient.hashCode());
		result = prime * result
				+ ((photo_patient == null) ? 0 : photo_patient.hashCode());
		long temp;
		temp = Double.doubleToLongBits(poids_patient);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result
				+ ((prenom_patient == null) ? 0 : prenom_patient.hashCode());
		result = prime * result
				+ ((sexe_patient == null) ? 0 : sexe_patient.hashCode());
		temp = Double.doubleToLongBits(taille_patient);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result
				+ ((ville_patient == null) ? 0 : ville_patient.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Patient other = (Patient) obj;
		if (adresse_patient == null) {
			if (other.adresse_patient != null)
				return false;
		} else if (!adresse_patient.equals(other.adresse_patient))
			return false;
		if (code_postal_patient != other.code_postal_patient)
			return false;
		if (date_naissance_patient == null) {
			if (other.date_naissance_patient != null)
				return false;
		} else if (!date_naissance_patient.equals(other.date_naissance_patient))
			return false;
		if (email_patient == null) {
			if (other.email_patient != null)
				return false;
		} else if (!email_patient.equals(other.email_patient))
			return false;
		if (nom_patient == null) {
			if (other.nom_patient != null)
				return false;
		} else if (!nom_patient.equals(other.nom_patient))
			return false;
		if (numero_portable_patient == null) {
			if (other.numero_portable_patient != null)
				return false;
		} else if (!numero_portable_patient
				.equals(other.numero_portable_patient))
			return false;
		if (numero_securite_sociale_patient == null) {
			if (other.numero_securite_sociale_patient != null)
				return false;
		} else if (!numero_securite_sociale_patient
				.equals(other.numero_securite_sociale_patient))
			return false;
		if (numero_telephone_patient == null) {
			if (other.numero_telephone_patient != null)
				return false;
		} else if (!numero_telephone_patient
				.equals(other.numero_telephone_patient))
			return false;
		if (photo_patient == null) {
			if (other.photo_patient != null)
				return false;
		} else if (!photo_patient.equals(other.photo_patient))
			return false;
		if (Double.doubleToLongBits(poids_patient) != Double
				.doubleToLongBits(other.poids_patient))
			return false;
		if (prenom_patient == null) {
			if (other.prenom_patient != null)
				return false;
		} else if (!prenom_patient.equals(other.prenom_patient))
			return false;
		if (sexe_patient == null) {
			if (other.sexe_patient != null)
				return false;
		} else if (!sexe_patient.equals(other.sexe_patient))
			return false;
		if (Double.doubleToLongBits(taille_patient) != Double
				.doubleToLongBits(other.taille_patient))
			return false;
		if (ville_patient == null) {
			if (other.ville_patient != null)
				return false;
		} else if (!ville_patient.equals(other.ville_patient))
			return false;
		return true;
	}
	

}
